<template name="editRequirement">
  <h1 class="submit-title">修改作业</h1>
  {{#if dued deadline}}
    <div class="alert alert-sucess">
      <p>本作业已经截止提交</p>
    </div>
    <h4>{{name}}</h4> 
    <hr>
    <p>{{content}}</p>
  {{else}}
    <form class="form-submit">
      <div class="form-group {{errorClass 'name' 'requirementEditErrors'}}">
        <label for="name">作业名称</label>
        <input type="text" class="form-control" name="name" value="{{name}}">
        <span class="help-block">{{errorMessage 'name' 'requirementEditErrors'}}</span>
      </div>

      <div class="form-group {{errorClass 'date' 'requirementEditErrors'}}">
        <label for="date">截止日期（yyyy-mm-dd）</label>
        <input type="date" class="form-control" name="date" value="{{formatDate deadline}}">
        <span class="help-block">{{errorMessage 'date' 'requirementEditErrors'}}</span>
      </div>

      <div class="form-group {{errorClass 'content' 'requirementEditErrors'}}">
        <label for="content">作业内容</label>
        <textarea name="content" id="content" class="form-control" rows="3">{{content}}</textarea>
        <span class="help-block">{{errorMessage 'content' 'requirementEditErrors'}}</span>
      </div>

      <button type="submit" class="btn btn-primary">提交</button>
    </form>
  {{/if}}

</template>